<?php include 'header.php'; ?>
<!-- search -->
<div class="posts">
	<p class="ing"><?php include 'ing.php'; ?></p>
	<p class="warn">Search results for <big><?php echo htmlspecialchars( $criteria ); ?></big></p>

<?php foreach ( $posts as $post ) { ?>
	<div class="postinfo">
		<h2 id="post-<?php echo $post->id; ?>">
			<a class="icon" title="<?php echo $post->title; ?>">»</a>
			<a href="<?php echo $post->permalink; ?>" title="<?php echo $post->title; ?>"><?php echo $post->title_out; ?></a>
		</h2>
		<span class="alignleft">
			<a class="icon" title="Date Time">☀</a><?php echo $post->pubdate_out; ?> 
			<a class="icon" title="Tags"> ❐</a><?php if ( is_array( $post->tags ) ) { echo $post->tags_out; } ?>
			<?php if ( $user ) { ?> 
			<a class="icon" title="Edit"> ✎</a><a href="<?php URL::out( 'admin', 'page=publish&slug=' . $post->slug); ?>" title="Edit post">Edit</a>
			<?php } ?>
		</span>
		<span class="alignright">
			<a href="<?php echo $post->permalink; ?>" title="Comment on this post"><strong><?php echo $post->comments->approved->count; ?></strong> <?php echo _n( 'Comment', 'Comments', $post->comments->approved->count ); ?></a>
		</span>
	</div>
    <?php echo $post->content_out; ?>
<?php } ?>
 
    <div class="Nav">
     	<span>Pages:</span>&nbsp;<?php echo Utils::page_selector( $page, Utils::archive_pages( $posts->count_all() ) ); ?>
    </div>
	<div id="clear"></div>
 
</div><!-- /posts -->

<?php include 'sidebar.php'; ?>
<!-- /search -->
<?php include 'footer.php'; ?>
